# _*_ coding: utf-8 _*_
from odoo import models, api, fields


class AssignPurchaseRequisitionLine(models.TransientModel):
    _name = "assign.purchase.requisition.line.wizard"

    user_id = fields.Many2one("res.users", string="User", required=True)

    def action_ok(self):
        self.ensure_one()
        lines = self.env["purchase.requisition.line"].browse(self.env.context.get("active_ids"))
        if lines:
            lines.write({
                "user_id": self.user_id.id,
                "state": "assign"
            })
